package com.fantasizegame.project.gen.utils;

public interface StringUtils {

	static String lineToHump(String value) {

		int index = value.indexOf("_");
		if (index < 0) {
			return value;
		}

		StringBuilder	sb		= new StringBuilder();
		int				start	= 0;
		sb.append(value.substring(start, index));

		start = ++index;
		while ((index = value.indexOf("_", index)) > 0) {
			sb.append(value.substring(start, start + 1).toUpperCase());
			sb.append(value.substring(start + 1, index));
			start = ++index;

		}
		sb.append(value.substring(start, start + 1).toUpperCase());
		sb.append(value.substring(start + 1));

		return sb.toString();

	}
}
